﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DataAccess;
namespace SQT.tracnghiem.Ajax.ASP.Events
{
    public partial class ring_gdoc : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            int event_id = int.Parse(Request.QueryString["event_id"]);
            int player = int.Parse(Request.QueryString["player"]);

            var get_gdoc = new TblEventCrossWordController().FetchAll().Where(x => x.EventId == event_id);
            if(get_gdoc.ToList().Count!=0)
            {
                if (get_gdoc.Single().Ring == 0)
                    new TblEventCrossWordController().Update(get_gdoc.Single().Id, null, null, 0, player, null, player);
            }

        }
    }
}